package com.museum.controller.impl.admin;

import com.alibaba.fastjson.JSONObject;
import com.museum.base.BaseResponse;
import com.museum.controller.api.admin.AdminUserAPI;
import com.museum.entity.DTO.admin.AdminQueryUser;
import com.museum.entity.DTO.user.UserAdd;

import com.museum.service.impl.admin.AdminUserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @Description:
 * @ClassName museum
 * @Author: 王瑞文
 * @Date: 2020/12/28 19:34
 */
@RestController
@RequestMapping("/super/user")
public class AdminUserController implements AdminUserAPI {
    @Autowired
    private  AdminUserServiceImpl adminUserService;

    @Override
    public BaseResponse<JSONObject> updateUser(UserAdd user) {
        return adminUserService.updateUser(user);
    }

    /**
     * @param
     * @Desciption 条件查询
     * @return
     */
    public BaseResponse<JSONObject> getAllUser(long current, long limit, AdminQueryUser userQuery) {
        return adminUserService.getAllUser(current, limit, userQuery);
    }
    /**
     * @param
     * @Desciption 用户删除
     * @return
     */
    @Override
    public BaseResponse<JSONObject> deleteId(HttpServletRequest request, Integer userId) {
        return adminUserService.deleteId(request,userId);
    }

    @Override
    public BaseResponse<JSONObject> AddUser(HttpServletRequest request, UserAdd userAdd) {
        return  adminUserService.AddUser(request,userAdd);
    }
}
